package org.colswe.testingProject.entity;

import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author Leonardo Bohórquez
 * @version 1.0
 * @date 17/03/2012
 * Caso de uso: CU01
 */
@Entity
public class Person implements Serializable {

    public static final String USERS_ADMINISTRATOR = "USERS_ADMINISTRATOR";
    public static final String ADMINISTRATOR = "ADMINISTRATOR";
    public static final String[] USERS_ROLES = {USERS_ADMINISTRATOR, ADMINISTRATOR};
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long idPerson;
    @Column(length = 50, nullable = false, unique = true)
    private String userName;
    @Column(length = 30, nullable = false)
    private String password;
    @Column(length = 15, nullable = false)
    String roles;

    public Person() {
    }

    public Person(String userName, String password, String rol) {
        this.userName = userName;
        this.password = password;
        this.roles = rol;
    }

    public Long getIdPerson() {
        return idPerson;
    }

    public void setIdPerson(Long idPerson) {
        this.idPerson = idPerson;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRole() {
        return roles;
    }

    public void setRole(String rol) {
        this.roles = rol;
    }

    @Override
    public String toString() {
        return "Person{" + "idPerson=" + idPerson + ", rol=" + roles + '}';
    }
}
